#include <iostream>

template<typename T>
class Matrix
{
    private:
        size_t rows, cols;
        T *data;


    public:

        Matrix(size_t rows, size_t cols);
        ~Matrix();
        Matrix & operator+(const Matrix & a);
        Matrix  operator*(const Matrix & a);
        Matrix & operator+=(const Matrix & a);   
        void print(size_t row, size_t col);   
};

template<typename T>
Matrix<T>::Matrix(size_t rows, size_t cols):rows(rows), cols(cols)
{
    data = new T[rows * cols];
}

template<typename T>
Matrix<T>::~Matrix()
{
    delete []data;
}

template<typename T>
Matrix & Matrix<T>::operator+(const Matrix & a)
{
    assert(a.rows == this->rows && a.cols == this->cols);
    for(size_t i = 0; i < rows * cols; i++)
    {
        data[i] = data[i] + a.data[i];
    }
    return *this;
}

template<typename T>
Matrix  Matrix<T>::operator*(const Matrix & a)
{
    assert(this->cols == a.rows);
    Matrix<T> tmp(this->rows, a.cols);
    for(size_t i = 0; i < this->rows * a.cols; i++)
    {
        for()
        tmp.data[i] = 
    }
}

template<typename T>
Matrix  Matrix<T>::operator+=(const Matrix & a)
{
    return *this + a;
}

template <typename T>
void Matrix<T>::print(size_t row, size_t col)
{
    std::cout << "The value of the " << row << " rows " << col << " cols is " <<\
    data[row * this->cols + col] << std::endl;
}